package apiday02;
/**
 * matches 匹配格式
 * */
public class RegularExpression {
    public static void main(String[] args) {

        String a="2451127873qwe@.qq789.com";
        String a1="[\\w]+@+(\\.+[a-zA-Z]+)+";
        boolean matches = a.matches(a1);
        if (matches){
            System.out.println("输入正确");
        }else{
            System.out.println("输入错误");
        }


//        String mailbox="2451127873@qq.com";
//        String answer="[\\w]+@+[A-Za-z]+(\\.[A-Za-z]+)+";
//       boolean matches =mailbox.matches(answer);
//       if (matches){
//           System.out.println("邮箱格式匹配正确");
//       }else {
//           System.out.println("匹配错误");
//       }

    }
}
